﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace RAG.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class RAGInInit10 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_vectors_document_chunks_vector_chunk_id",
                table: "vectors");

            migrationBuilder.RenameColumn(
                name: "vector_chunk_id",
                table: "vectors",
                newName: "document_chunk_id");

            migrationBuilder.RenameIndex(
                name: "IX_vectors_vector_chunk_id",
                table: "vectors",
                newName: "IX_vectors_document_chunk_id");

            migrationBuilder.AddForeignKey(
                name: "FK_vectors_document_chunks_document_chunk_id",
                table: "vectors",
                column: "document_chunk_id",
                principalTable: "document_chunks",
                principalColumn: "id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_vectors_document_chunks_document_chunk_id",
                table: "vectors");

            migrationBuilder.RenameColumn(
                name: "document_chunk_id",
                table: "vectors",
                newName: "vector_chunk_id");

            migrationBuilder.RenameIndex(
                name: "IX_vectors_document_chunk_id",
                table: "vectors",
                newName: "IX_vectors_vector_chunk_id");

            migrationBuilder.AddForeignKey(
                name: "FK_vectors_document_chunks_vector_chunk_id",
                table: "vectors",
                column: "vector_chunk_id",
                principalTable: "document_chunks",
                principalColumn: "id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
